package com.crazyteam.datasource.dynamic;

final class DynamicDataSourceHolder {
    private static final ThreadLocal<String> holder = new ThreadLocal<>();

    static final String MASTER = "master";

    static final String SLAVE = "slave";

    private DynamicDataSourceHolder() {
        //
    }

    static void putDataSource(String dataSourceName){
        holder.set(dataSourceName);
    }

    static String getDataSource(){
        return holder.get();
    }

    static void clearDataSource() {
        holder.remove();
    }

}
